github.com-doganoo-PHPAlgorithms_-_2019-10-09_08-18-27
Item Preview
75 Views
IN COLLECTIONS
Github Mirror by Narabot The Vintage Software CollectionUploaded by narabot on
Ask the publishers to restore access to 500,000+ books.
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell
The library is in a beta state. Missing something? Create a pull request!
You can find the package on Packagist: https://packagist.org/packages/doganoo/php-algorithms
"Algorithms + Data Structures = Programs"
Algorithms are a part of the basic toolkit for solving problems. Data Structures organize data in an efficient way. The combination of both allow the creation of smart and efficient software.
You can install the package via composer:
bashcomposer require doganoo/php-algorithms
Here's an Binary Tree example:
```phpuse doganoo\PHPAlgorithms\Datastructure\Graph\Tree\BinaryTree;
$binaryTree = new BinaryTree();$binaryTree->insertValue(50);$binaryTree->insertValue(25);$binaryTree->insertValue(75);$binaryTree->insertValue(10);$binaryTree->insertValue(100);
echo json_encode($binaryTree);```
producesphp{"nodes":{"value":50,"left":{"value":25,"left":{"value":10,"left":null,"right":null},"right":null},"right":{"value":75,"left":null,"right":{"value":100,"left":null,"right":null}}}}
Feel free to send a pull request to add more algorithms and data structures. Please make sure that you read https://github.com/doganoo/PHPAlgorithms/wiki/Best-Practices before opening a PR.Please also consider https://github.com/doganoo/PHPAlgorithms/blob/master/CONTRIBUTING.md.
Doğan Uçar (@doganoo)
MIT
wget https://archive.org/download/github.com-doganoo-PHPAlgorithms_-_2019-10-09_08-18-27/doganoo-PHPAlgorithms_-_2019-10-09_08-18-27.bundle
and run: git clone doganoo-PHPAlgorithms_-_2019-10-09_08-18-27.bundle
75 Views
Uploaded by narabot on